button: Reset in_button state in unmap
authorTimm Bäder <mail@baedert.org>
Sun, 2 Jul 2017 18:45:23 +0000 (20:45 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 20 Jul 2017 01:27:15 +0000 (21:27 -0400)
Since at that point the point is clearly not in the button anymore.

gtk/gtkbutton.c

index 01593226bed37d90a72d3918b7c584fbb305f365..d663d1294ae36341c7150bd52b6990d357cf6cdc 100644 (file)
@@ -182,6 +182,13 @@ gtk_button_remove (GtkContainer *container, GtkWidget *child)
   GTK_CONTAINER_CLASS (gtk_button_parent_class)->remove (container, child);
 }
 
+static void
+gtk_button_unmap (GtkWidget *widget)
+{
+  GTK_BUTTON (widget)->priv->in_button = FALSE;
+  GTK_WIDGET_CLASS (gtk_button_parent_class)->unmap (widget);
+}
+
 static void
 gtk_button_class_init (GtkButtonClass *klass)
 {
@@ -208,6 +215,7 @@ gtk_button_class_init (GtkButtonClass *klass)
   widget_class->leave_notify_event = gtk_button_leave_notify;
   widget_class->state_flags_changed = gtk_button_state_flags_changed;
   widget_class->grab_notify = gtk_button_grab_notify;
+  widget_class->unmap = gtk_button_unmap;
 
   container_class->add    = gtk_button_add;
   container_class->remove = gtk_button_remove;